Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON schema checking functionality for DRep and Gov action metadata #713

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

palas
Copy link
Contributor

@palas palas commented Dec 20, 2024

Changelog

- description: |
    Added schema checking functionality for DRep registration, DRep update, and GovAction metadata, based on CIP-0100, CIP-0108, and CIP-0119. Also add functionality to check whether a certificate is for DRep registration or updating.
  type:
  - feature
  - compatible
  - test

Context

The objective is addressing this issue: IntersectMBO/cardano-cli#906

This PR adds 3 functions to the API that should be the only ones needed by the cardano-cli in order to implement this functionality:

  • isDRepRegOrUpdateCert - Checks whether a certificate is for DRep registration or DRep update.
  • validateDRepAnchorData - Checks whether a ByteString is valid JSON and conforms to CIP-0119.
  • validateGovActionAnchorData - Checks whether a ByteString is valid JSON and conforms to CIP-0108

This PR is a requirement from PR #995 that implements the checking in cardano-cli and is based of the version of cardano-api in this PR.

Related PRs in CIPs repo:

  • PR #950 - Adds @ before type field name
  • PR #951 - Ensures CIP-0008 is in capital letters

How to trust this PR

Tests should give some assurance. They are taken from the CIPs repo, with some adaptations that I have already created PRs in CIPs repo for (see above).

The main thing to check here is the accuracy of the checks (are they enough, are they too much, are they right).

Could be useful to check the cardano-cli PR together with this one.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@palas palas force-pushed the gov-action-schema-checking branch from 4c6424e to 4168561 Compare December 20, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Governance metadata is not validated
1 participant